package com.xiaoge.controller;

import com.xiaoge.service.DepartmentService;
import com.xiaoge.utils.ResData;
import com.xiaoge.utils.ResponseDataUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
@RestController
@RequestMapping("/department")
public class DepartmentController {

    @Resource
    DepartmentService departmentService;

    @RequestMapping("/getAll")
    public ResData getAll(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("data",departmentService.getAll());
        return ResponseDataUtil.successData(map);
    }
}
